package asimes.reflect;

import org.joor.Reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class TestConstructor {
    public static void main(String[] args) {
        Object object = null;
        try {
            Constructor<String> constructor = String.class.getConstructor(String.class);
            object = constructor.newInstance("Jack");
            System.out.println(object);
        } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }

        Object jack = Reflect.on("java.lang.String").create("Jack").get();
        System.out.println(jack);
    }
}
